<template>
  <div class="container">
    <div class="message-item" v-for="(item, index) in messages" :key="index">
      <div class="time">{{ item.releasetime }}</div>
      <div class="message-box">
        <p class="title" v-if="item.title">{{ item.title }}</p>
        <p class="next-title" v-if="item.subtitle">{{ item.subtitle }}</p>
        <p class="content">{{ item.content }}</p>
      </div>
    </div>
    <div class="no-message" v-if="messages.length === 0">暂无消息</div>
  </div>
</template>

<script>
export default {
  name: 'messageList',
  data () {
    return {}
  },
  methods: {},
  props: ['messages'],
  created () {}
}
</script>

<style scoped>
  .container{
    padding: 10px 15px 20px 15px;
    background-color: #f2f2f2;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
  }
  .message-item{
    margin-top: 35px;
  }
  .message-item .message-box{
    min-height: 120px;
    background: #fff;
    box-shadow: 0px 0px 6px rgba(0,0,0,0.1);
    border-radius: 5px;
    padding: 20px;
    font-size:18px;
    font-family:PingFang SC;
    font-weight:bold;
    line-height:30px;
    color:rgba(30,30,30,1);
  }
  .message-item .time{
    font-size: 13px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 36px;
    color: rgba(102,102,102,1);
    text-align: center;
  }
  .no-message{
    text-align: center;
    padding: 20px 0;
  }
</style>
